<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <f:metadata>
        <f:event type="preRenderView" listener="#{sessionManaged.validar_session('wfrmModulo')}"/>
    </f:metadata>
    <body>
        <ui:composition template="./../../../template.xhtml">
            <ui:define name="main_content">
                <ui:include src="/web-pages/OTROS/HELP/wfrmHelp_mtto.xhtml">
                    <ui:param name="toolBarWidth" value="750"/>
                    <ui:param name="toolBarTitleWidth" value="700"/>
                    <ui:param name="title" value="M&oacute;dulo"/>
                </ui:include>
                <div align="left">

                    <p:panel header="Informaci&oacute;n de M&oacute;dulo" style="width:750px" >
                        <ui:include src="/web-pages/OTROS/wfrmMensaje.xhtml"/>
                        <h:form id="modulo">
                            <h:panelGrid id="pModulo" columns="2" style="width:inherit" >
                                <h:outputText value="Nombre" /> <p:inputText value="#{moduloManaged.selectedModulo.nombre_m}" style="width: 450px"/>
                            </h:panelGrid>

                            <div align="center">
                                <h:panelGrid id="cmdButtones" columns="2" cellpadding="5" style="width:inherit">
                                    <p:commandButton value="#{sms.guardar}" onclick="cmdConfirm.show()" image="ui-icon ui-icon-check"/>
                                    <p:commandButton value="#{sms.limpiar}" actionListener="#{limpiarManaged.limpiar}" update="modulo:pModulo grid:table"/>
                                    <p:confirmDialog message="#{sms.iAlmacenada}" header="#{sms.guardar}" severity="alert" widgetVar="cmdConfirm">
                                        <p:commandButton value="Si" actionListener="#{moduloManaged.mantenimientoModulo}" update="grid:table modulo:pModulo mensaje" oncomplete="cmdConfirm.hide()" />
                                        <p:commandButton value="No" onclick="cmdConfirm.hide()" />
                                    </p:confirmDialog>
                                </h:panelGrid>
                            </div>
                        </h:form>
                        <h:form id="grid">
                            <p:panel header="Datos de M&oacute;dulo" style="width: inherit" >
                                <f:facet name="header">
                                    <h:outputText value="Datos de M&oacute;dulo"/> &nbsp;
                                    <p:commandButton image="ui-icon ui-icon-search" actionListener="#{moduloManaged.fillGrid}" update="grid:table mensaje" title="Buscar M&oacute;dulo"/>
                                </f:facet>

                                <p:dataTable id="table" value="#{moduloManaged.modulos}" var="row" rows="15"
                                             paginator="true" paginatorPosition="bottom" selectionMode="single" selection="#{moduloManaged.selectedModulo}"
                                             emptyMessage="#{sms.TableEmptyMessage}" onRowSelectUpdate="modulo:pModulo mensaje" >
                                    <f:facet name="header" >
                                        <h:outputText value="Lista de M&oacute;dulo" />
                                    </f:facet>
                                    <p:column headerText="M&oacute;dulo" filterBy="#{row.nombre_m}" sortBy="#{row.nombre_m}" filterMatchMode="contains">
                                        <h:outputText value="#{row.nombre_m}"/>
                                    </p:column>
                                </p:dataTable>
                            </p:panel>

                        </h:form>

                    </p:panel>
                </div>
            </ui:define>


        </ui:composition>

    </body>
</html>
